import { FileItem } from '@arco-design/web-vue';
import { User } from '@/types/user';

export interface CmsAuthor {
  id: string;
  authorName: string;
  gmtCreate: string;
  gmtUpdate: string;
}

export interface CmsColumn {
  id: string;
  columnName: string;
  columnPic: string;
  columnPicFileList?: FileItem[];
  sortNo: number;
  parentId?: string;
  gmtCreate: string;
  gmtUpdate: string;
  children?: CmsColumn[];
}

export interface CmsArticle {
  id: string;
  gmtCreate: string;
  gmtUpdate: string;
  columnId: string;
  cmsColumn: CmsColumn;
  authorId: string;
  cmsAuthor: CmsAuthor;
  articleTitle: string;
  articleAbstract: string;
  coverUrl: string;
  coverPicFileList?: FileItem[];
  content: string;
  contentType: number;
  publishTime: string;
  tags: string;
  tagList: string[];
  state: number;
  coinScoreRead?: number;
  coinScoreComment?: number;
}

export interface CmsArticleSearch {
  state: number;
  columnId: string;
  articleTitle: string;
  authorId: string;
  publishRange: string[];
  contentType: number;
  publishTime: string;
}

export interface CmsCommentSearch {
  articleId?: string;
  state?: number;
}

export interface CmsComment {
  id: number;
  articleId: string;
  cmsArticle?: CmsArticle;
  userId: string;
  user?: User;
  content: string;
  cover?: string;
  parentId?: number;
  parentComment?: CmsComment;
  state: number;
  gmtCreate: string;
}

export interface CmsExamQuestionChoice {
  title: string;
}

export interface CmsExamQuestion {
  id: number;
  examId: string;
  title: string;
  rightChoice?: string;
  sortNum: number;
  questionChoice?: string;
  choices?: Partial<CmsExamQuestionChoice>[];
  gmtCreate: string;
  gmtUpdate?: string;
}

export interface CmsExam {
  id: string;
  articleId: string;
  questions?: Partial<CmsExamQuestion>[];
  coinPointCount: number;
  eightCoinPointCount: number;
  passCoinPointCount: number;
  title: string;
  gmtCreate: string;
  gmtUpdate?: string;
}

export interface CmsExamUserAnswer {
  id: number;
  userId: string;
}
